#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "libsdk.h"

void initGoString(GoString *s, const char*str){
    s->p = str;
    s->n = strlen(str);
}

int init() {
    char *str = "15gDMT9uMinAFi5x1sVpWaftLV8UYJp8t8cLG1r8HHQUbMiJBjxNsZnMfzWvErLAQ6ym53K4C6A22iKUm";
    char *key = malloc(strlen(str));
    strcpy(key, str);
    char *address = "estore.guanjieai.com:10000";
    char *addr = malloc(strlen(address));
    strcpy(addr, address);
    int ret= Init(key, addr);
    free(key);
    free(addr);
    return ret;
}


int main() {
   int ret = init();
    printf("Init %d\n",ret);
    if(ret != 0){
        printf("init failed\n");
        return 0;
    }

    //DownloadFile("/dy888.mkv","~/dy.mkv");
    DeleteObject("/dy.mkv");


//    ret = DownloadFile(key,outFile);
//    printf("DownloadFile %d",ret);
    ///abcd/333/32
}